<?php

require("top.ajax.php");

if(isset($_SESSION['user'])) {
    /* Devenir fan */
    if(isset($_POST['user_id']) && isset($_POST['vendor_id'])) {
        $vendor = new Vendor($_POST['vendor_id']);
        $vendor->addFan($_SESSION['user']);

        $nf = new Newsfeed("shop", AJAX_XML_PATH);
        $nf->addFeed($_SESSION['user'], "est devenu fan de", $vendor);
    }
}

?>
